module.exports = class extends think.Controller {
  async indexAction () {
    var data = this.post()
    var db = this.mongoose('mongoose/timeout')
    console.log('设置超时')
    var datas = {
      cs_id: parseInt(data.cs_id),
      timeout: parseInt(data.timeout),
      isinure: data.isinure
    }
    try {
      var result = await db.update({cs_id: parseInt(data.cs_id)}, {$set:datas})
      console.log('设置成功')
      console.log('result')
      this.json( { status: 1, msg: '设置成功'})
    } catch (e) {
      console.log('设置失败')
      this.ctx.fail( 1000, e.message)
    }
  }
}